package com.wzh.dao;


import com.wzh.pojo.Po.Subject;
import com.wzh.pojo.Po.User;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface Subjectdao{

	@Update("update subject set createtime=#{createtime},subname=#{subname},subtitle=#{subtitle},subteacherid=#{subteacherid} where subid=#{subid}")
	int updatbyid(Subject subject);

	@Delete("delete from subject where subid=#{subid}")
	int deonebyid(Subject subject);

	@Insert("insert into subject (subid,subname,subtitle,subteacherid,createtime) value (#{subid},#{subname},#{subtitle},#{subteacherid},#{createtime})")
	int addnew(Subject subject);

	@Select("select * from subject ")
	List<Subject> getAll();

	@Select("select * from subject where id=#{subid}")
	List<User> getbyid(int id);
}
